package cn.huiyunche.driver.datasync.schedule;

import cn.huiyunche.base.service.interfaces.DWaybillService;
import org.quartz.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.io.Serializable;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;

@PersistJobDataAfterExecution
@DisallowConcurrentExecution
public class OrderToTmsSchedule implements Job, Serializable {

    private static final Logger LOGGER = LoggerFactory.getLogger(OrderToTmsSchedule.class);

    /**
     * 订单推送运力平台失败 定时推送
     * @param context
     * @throws JobExecutionException
     */
    @Override
    public void execute(JobExecutionContext context) throws JobExecutionException {
        DateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        LOGGER.info("OrderToTmsSchedule.execute start : {}", df.format(new Date()));
        DWaybillService dWaybillService = QuartzClusterFactory.DWaybillService();
        dWaybillService.OrderToTms();
        LOGGER.info("OrderToTmsSchedule.execute end time : {}", df.format(new Date()));
    }
}
